extends ItemComp

@export var item_data:Array[String]
@onready var optionButton = %optionbutton

func _ready():
	for item in item_data:
		optionButton.add_item(item)
	optionButton.selected = 0

func _get_data():
	return item_data[optionButton.selected]

func _set_data(data):
	optionButton.selected = item_data.find(data)

func _on_optionbutton_item_selected(_index):
	data_changed.emit()
